package com.rico.converter;

import org.springframework.context.annotation.Bean;
import org.springframework.context.support.ConversionServiceFactoryBean;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import java.util.HashSet;
import java.util.Set;

@Component
public class ConverterConfigs {

    @Bean
    public ConversionServiceFactoryBean conversionService(){
        ConversionServiceFactoryBean conversionServiceFactoryBean=  new ConversionServiceFactoryBean();
        Set<Converter> converterSet=new HashSet<>();
        converterSet.add(new DateConverter());
        conversionServiceFactoryBean.setConverters(converterSet);
        return conversionServiceFactoryBean;
    }
}
